namespace CloudTree.Migrations
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;
    using CloudTree.Domain;

    internal sealed class Configuration : DbMigrationsConfiguration<CloudTree.Infrastructure.DepartmentDB>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;//Enables quick database changes without adding additional code to solution
        }

        protected override void Seed(CloudTree.Infrastructure.DepartmentDB context)//Seed alows initial population of information in the database
        {
            context.Departments.AddOrUpdate(d => d.Name,
                new Department() { Name = "Computing" },
                new Department() { Name = "Engineering" },
                new Department() { Name = "Medias" },
                new Department() { Name = "Media2s" }
                );
        }
    }
}
